#region (c) 2014 THN Solutions LLC. - All rights reserved
/*
THN MVC MODULE FOR THN WEB SERVER

Copyright (c) 2014, THN Solutions LLC. ( www.ThnSolutions.com )
Author: Nguyễn, M. Hải                 ( www.Minh-Hai.com     )
All rights reserved.

This library is dual-licensed.
  + For use in commercial software, please obtain a commercial license from THN Solutions LLC.    

  + For use in free software, this library is licensed under GPL version 3. A summary of 
	GPLv3 is listed below. You should also find a copy of GPLv3 as file License_GPLv3.txt 
	included with the source-code files.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 3 as published by
    the Free Software Foundation  of the License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#endregion

#region Record of Change
//             							CHANGE HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | DEVELOPER  | DESCRIPTION                                              |
// -------------------------------------------------------------------------------------
// | 17-Apr-13 | HaiNM      | First creation.                                          |
// -------------------------------------------------------------------------------------
//
#endregion

#region Record of Audit
//             							REVIEW HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | REVIEWER   | NOTES                                                    |
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
//
#endregion

#region Using directives
using System;

using Thn.Net.Http;
#endregion

namespace Thn.Web.Mvc
{
    /// <summary>
    /// A controller manager is responsible for handling <see cref="IViewController"/>s.
    /// </summary>
#if DEBUG
    public
#else
    public
#endif
 interface IControllerManager
    {
        #region Register Controller
        /// <summary>
        /// Register a controller to be managed.
        /// </summary>
        void RegisterController(IViewController controller);
        #endregion

        #region Renderer
        /// <summary>
        /// Gets or sets the renderer responsible for rendering views.
        /// </summary>
        IViewRenderer Renderer
        { get; set; }
        #endregion

        #region Execute - Direct
        ///// <summary>
        ///// Execute a controller's logic.
        ///// </summary>
        ///// <param name="httpContext">The context associated with current HTTP request.</param>
        ///// <param name="controllerName">Name of the controller to be executed.</param>
        ///// <param name="methodName">Name of the method to be executed.</param>
        ///// <param name="args">Parameters to be passed to the method.</param>
        ///// <returns>The result returned after executing the controller.</returns>
        //object Execute(IHttpRequestHandlingContext httpContext, string controllerName, string methodName, params object[] args);
        #endregion

        #region Execute - Indirect
        /// <summary>
        /// Execute a controller's logic. The method and parameters shall be inferred from the provided query.
        /// </summary>
        /// <param name="httpContext">The context associated with current HTTP request.</param>
        /// <param name="controllerName">Name of the controller to be executed.</param>
        /// <param name="methodName">Name of the method to be executed.</param>
        /// <param name="query">The URL query, if available</param>
        /// <returns>The result returned after executing the controller.</returns>
        object Execute(IHttpRequestHandlingContext httpContext, string controllerName, string methodName, UrlQuery query);
        #endregion
    }
}
